package com.ijiuchuang.jc_localization.view.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.ijiuchuang.jc_localization.R;
import com.ijiuchuang.jc_localization.view.activity.ToolsRssiActivity;
import com.ijiuchuang.jc_localization.view.activity.ToolsSignInActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class ToolsFragment extends Fragment {

    @BindView(R.id.tools_button_rssi)
    Button buttonRssi;
    @BindView(R.id.tools_button_signin)
    Button buttonSignin;

    public ToolsFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_tools, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @OnClick({R.id.tools_button_rssi, R.id.tools_button_signin})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tools_button_rssi:
                Intent intentRssi = new Intent(getActivity(), ToolsRssiActivity.class);
                startActivity(intentRssi);
                break;
            case R.id.tools_button_signin:
                Intent intentSignIn = new Intent(getActivity(), ToolsSignInActivity.class);
                startActivity(intentSignIn);
                break;
        }
    }
}
